package org.halk.job_client.schedule;

import lombok.extern.slf4j.Slf4j;
import org.halk.job_client.annotion.BiJob;
import org.halk.job_client.annotion.BiJobMapping;

import java.util.Date;

/**
 * @Author haozhu7
 * @Date 2024/9/28 16:39
 **/
@Slf4j
//@BiJob
public class TestSchedule {

//    @BiJobMapping("job-client.test01")
    public void test01() throws Exception {
        int v = (int) (10000 + 10000 * Math.random());
        log.info("定时任务执行： {}，随机等待： {}", new Date(), v);
        Thread.sleep(v);
        if (v > 15000 && v < 16000) {
            throw new RuntimeException("测试异常");
        }
        log.info("定时任务执行结束： {}", new Date());
    }
}
